package com.ebei.admin.model.dto;

import com.ebei.admin.common.util.TreeNode;
import com.ebei.common.vo.MenuVO;
import lombok.Data;

/**
 *  菜单树
 *
 * @author crazypenguin
 * @version 1.0
 * @created 2018/4/17
 */
@Data
public class MenuTree extends TreeNode {
    private String name;
    private String url;
    private String type;
    private String menuCode;
    private Boolean checked; //是否选中 用于角色页面
    private String createDate;
    private Boolean open; //控制菜单是否展开

    public MenuTree() {
    }

    public MenuTree(int id, String name, int parentId) {
        this.id = id;
        this.parentId = parentId;
        this.name = name;
    }

    public MenuTree(int id, String name, MenuTree parent) {
        this.id = id;
        this.parentId = parent.getId();
        this.name = name;
    }

    public MenuTree(MenuVO menuVo) {
        this.id = menuVo.getMenuId();
        this.parentId = menuVo.getParentId();
        this.name = menuVo.getMenuName();
        this.url = menuVo.getUrl();
        this.type = menuVo.getMenuType();
    }
}
